Frontend Forever App
We have a mobile app for you to download and use. And you can unlock many features in the app.
Get it now
Intall Later
Run
HTML
CSS
Javascript
Output
Document
Synthwave Time Tracker
You've been working for
00:00:00
00:00:00
HOURS
MINUTES
SECONDS
START
STOP
RESET
@charset "UTF-8"; @import url(https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800); *, :after, :before { box-sizing: border-box; padding: 0; margin: 0; } @import url("https://fonts.googleapis.com/css2?family=Mr+Dafoe&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Exo:wght@900&display=swap"); body, html { width: 100%; height: 100%; margin: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-direction: column; background: radial-gradient(rgba(118, 0, 191, 0.5) 0%, transparent 70%), linear-gradient(#0b161e 40%, #202076 70%); perspective: 700px; font-size: clamp(10px, 2vw, 20px); } .grid { background: linear-gradient( transparent 65%, rgba(46, 38, 255, 0.4) 75%, #7d41e6 80%, rgba(46, 38, 255, 0.4) 85%, transparent 95% ), linear-gradient( 90deg, transparent 65%, rgba(46, 38, 255, 0.4) 75%, #7d41e6 80%, rgba(46, 38, 255, 0.4) 85%, transparent 95% ); background-size: 30px 30px; width: 200vw; height: 300vh; position: absolute; bottom: -120vh; transform: rotateX(-100deg); -webkit-mask-image: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0) 80%); mask-image: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0) 80%); } .lines { position: fixed; width: 100vw; height: 4em; background: linear-gradient( rgba(89, 193, 254, 0.2) 20%, #59c1fe 40%, #59c1fe 60%, rgba(89, 193, 254, 0.2) 80% ); background-size: 1px 0.5em; box-shadow: 0 0 1em rgba(89, 193, 254, 0.4); transform: translateY(-1em); left: 0; } h1 { position: relative; font-family: "Exo", sans-serif; font-size: 9em; margin: 0; margin-top: -0.1em; letter-spacing: 0.03em; } h1::after { content: ""; position: absolute; top: 0.05em; right: 0.1em; width: 0.3em; height: 0.3em; background: radial-gradient( white 3%, rgba(255, 255, 255, 0.3) 15%, rgba(255, 255, 255, 0.05) 60%, transparent 80% ), radial-gradient(rgba(255, 255, 255, 0.2) 50%, transparent 60%) 50% 50% / 5% 100%, radial-gradient(rgba(255, 255, 255, 0.2) 50%, transparent 60%) 50% 50% / 70% 5%; background-repeat: no-repeat; } h1 span:first-child { display: block; text-shadow: 0 0 0.1em #8ba2d0, 0 0 0.2em black, 0 0 5em #165ff3; -webkit-text-stroke: 0.06em rgba(0, 0, 0, 0.5); } h1 span:last-child { position: absolute; left: 0; top: 0; background-image: linear-gradient( #032d50 25%, #00a1ef 35%, white 50%, #20125f 50%, #8313e7 55%, #ff61af 75% ); -webkit-text-stroke: 0.01em #94a0b9; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; } h2 { font-family: "Mr Dafoe", cursive; margin: 0; font-size: 5.5em; margin-top: -0.6em; color: white; text-shadow: 0 0 0.05em #fff, 0 0 0.2em #fe05e1, 0 0 0.3em #fe05e1; transform: rotate(-3deg); position: relative; z-index: 1; } .labels { display: flex; justify-content: space-between; width: 100%; max-width: 800px; margin-top: -40px; font-family: "Exo", sans-serif; font-size: 1.2em; color: white; text-shadow: 0 0 0.1em #8ba2d0, 0 0 0.2em black, 0 0 5em #165ff3; } .labels span { text-align: center; flex: 1; text-transform: uppercase; } .button-container { display: flex; justify-content: center; gap: 20px; margin-top: 30px; z-index: 10; } .synthwave-button { font-family: "Exo", sans-serif; font-size: 1.2em; font-weight: bold; padding: 10px 30px; color: #fff; background: linear-gradient(45deg, #ff00ff, #00ffff); border: none; border-radius: 50px; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 2px; box-shadow: 0 0 10px rgba(255, 0, 255, 0.7), 0 0 20px rgba(0, 255, 255, 0.7); text-shadow: 0 0 5px rgba(255, 255, 255, 0.7); position: relative; overflow: hidden; -webkit-text-stroke: 0.06em rgba(0, 0, 0, 0.5); } .synthwave-button::before { content: ""; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px; background: linear-gradient(45deg, #ff00ff, #00ffff, #ff00ff, #00ffff); z-index: -1; filter: blur(5px); background-size: 400%; opacity: 0; transition: opacity 0.3s; border-radius: 50px; } .synthwave-button:hover::before { opacity: 1; } .synthwave-button:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(255, 0, 255, 0.9), 0 0 30px rgba(0, 255, 255, 0.9); } .synthwave-button:active { transform: scale(0.95); } .synthwave-button:disabled { opacity: 0.5; cursor: not-allowed; } /* Safari-specific styles for text-shadow on h1 numbers */ @media (-webkit-min-device-pixel-ratio: 0) { h1 span:first-child { text-shadow: none !important; } }
console.log("Event Fired") let timerText = document.getElementById("timer-text"); let timerShadow = document.getElementById("timer-shadow"); let hoursLabel = document.getElementById("hours-label"); let minutesLabel = document.getElementById("minutes-label"); let secondsLabel = document.getElementById("seconds-label"); let startButton = document.getElementById("start-button"); let stopButton = document.getElementById("stop-button"); let resetButton = document.getElementById("reset-button"); let startTime; let timerInterval; let elapsedTime = 0; function updateTimer() { let totalSeconds = Math.floor(elapsedTime / 1000); let hours = Math.floor(totalSeconds / 3600); let minutes = Math.floor((totalSeconds % 3600) / 60); let seconds = totalSeconds % 60; let displayText = padZero(hours) + ":" + padZero(minutes) + ":" + padZero(seconds); timerText.textContent = displayText; timerShadow.textContent = displayText; hoursLabel.textContent = "HOURS"; minutesLabel.textContent = "MINUTES"; secondsLabel.textContent = "SECONDS"; // Save current state to localStorage localStorage.setItem( "timerState", JSON.stringify({ elapsedTime: elapsedTime, isRunning: !!timerInterval }) ); } function padZero(num) { return num.toString().padStart(2, "0"); } function startTimer() { if (!timerInterval) { startTime = Date.now() - elapsedTime; timerInterval = setInterval(() => { elapsedTime = Date.now() - startTime; updateTimer(); }, 1000); startButton.disabled = true; stopButton.disabled = false; resetButton.disabled = false; } } function stopTimer() { if (timerInterval) { clearInterval(timerInterval); timerInterval = null; startButton.disabled = false; stopButton.disabled = true; } } function resetTimer() { stopTimer(); elapsedTime = 0; updateTimer(); startButton.disabled = false; stopButton.disabled = true; resetButton.disabled = true; } startButton.addEventListener("click", startTimer); stopButton.addEventListener("click", stopTimer); resetButton.addEventListener("click", resetTimer); // Load saved state from localStorage window.addEventListener("load", () => { const savedState = JSON.parse(localStorage.getItem("timerState")); if (savedState) { elapsedTime = savedState.elapsedTime; if (savedState.isRunning) { startTimer(); } } updateTimer(); }); // Initially disable stop and reset buttons stopButton.disabled = true; resetButton.disabled = true;